<template lang="">
  <a-modal :visible="visible" :title="title" :centered="true" :closable="false">
    <template #footer>
      <a-checkbox v-model:checked="checked">{{ $t('jinR') }}</a-checkbox>
      <a-button key="back" @click="handleCancel" size="large">{{ $t('zhiD') }}</a-button>
      <a-button key="submit" type="primary" :loading="loading" @click="handleOk" size="large">{{ $t('chaK-0') }}</a-button>
    </template>
    <div v-if="content" class="content">
      {{ content }}
    </div>
    <slot v-else></slot>
  </a-modal>
</template>
<script setup lang="ts">
import { ref, defineProps, defineEmits } from 'vue';
import { setNoticeStatus } from '@/utils/notice';
import { useI18n } from 'vue-i18n'
const { t } = useI18n()

const props = defineProps({
  visible: {
    type: Boolean,
    required: true,
  },
  title: {
    type: String,
    required: true,
  },
  content: {
    type: String,
    required: true,
  }
});

const loading = ref<boolean>(false);
const checked =  ref<boolean>(false);

const emits = defineEmits(['ok', 'cancel']);
const handleOk = () => {
  modalClose();
  emits('ok');
};
const handleCancel = () => {
  modalClose();
  emits('cancel');
};
const modalClose = () => {
  if (checked) {
    setNoticeStatus()
  }
}
</script>
<style lang="">
  
</style>